package com.OrderingServer.service.impl;

import com.OrderingServer.pojo.OrderDetail;
import com.OrderingServer.mapper.OrderDetailMapper;
import com.OrderingServer.pojo.OrderMaster;
import com.OrderingServer.service.IOrderDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xingo
 * @since 2025-08-13
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements IOrderDetailService {
    @Autowired
    OrderDetailMapper orderDetailMapper;
    @Override
    public PageInfo<OrderDetail> selectPage(Integer pageSize, Long orderId) {
        //设置分页插件
        PageHelper.startPage(1, pageSize);
        //正常查询，查询数据
        QueryWrapper<OrderDetail> queryWrapper = new QueryWrapper<OrderDetail>();
        queryWrapper.like(true,"order_id",orderId);
        queryWrapper.eq("del","0");//未删除
        List<OrderDetail> list = orderDetailMapper.selectList(queryWrapper);
        return PageInfo.of(list);
    }
}
